Fixed mark duplicates

There were a lot of bugs in the duplicates feature.  Decided keeping
track of each change was too complicated so now it's clearing and
re-finding duplicates on every input.
Merge branch 'master' into gh-pages