fix duplicate documents and tests for add/remove files to index
this fixes #7