search-engine: recording file metadata

In order to support incremental updates, it's necessary to be able to
tell which files have been modified since the index was built.  So now
it records that information in a file `documents` under the index
directory, which means that we have to identify segments in a
different way.
search-engine: a couple of tiny shortenings

It's arguable whether these make the code better or just shorter.
a couple more items for TODO