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