For fiddling with id allocation

- in update_index(), build the new index first, then assign to
self.index in one swell foop
- dup.visit() should visit itself, but set the dup’s item_id to null
anyway to be sure

Fixes #228