Bug 1016239 - [Collections App][Part 1] Extract dedupe logic from search.js

https://bugzilla.mozilla.org/show_bug.cgi?id=1016239