search-engine: properly handling relative paths

Previously the search engine was storing whatever pathnames it was
using at the time that it generated the index, which might be absolute
(in which case, no problem) or relative to wherever the current
directory was when the indexer was run.  Now, it makes the paths
always relative, and relative to the parent directory of the index;
and upon extracting the pathnames for a query, it converts them to be
relative to wherever you happen to be, so that it can successfully
open the files.

This has the drawback (?) that if you're not inside the search index
directory, you may end up with results that begin with a lot of
"../../../..".
Merge branch 'master' of github.com:kragen/500lines