This is a rebased/squashed version of @aberenyi's work in #6185. I added one additional commit to avoid looping through all attributions for each source.
Ignore duplicate attributions.
Add test for duplicated attribution
Create a lookup of unique attributions
@tschaub looks good to me
Post-merge +1. Thanks!