Adds test for duplicate key insert
Fixes #333 by catching exceptions thrown when moving to oldDocuments
Merge pull request #341 from laserval/fix-333-crash-on-duplicate-key-insert

Fix 333 crash on duplicate key insert