Directory snapshotting works

The database schema has been rearranged to have revisions owned by
snapshots and referencing paths/contents-by-hash.

Directory enumeration is Windows-only so far.