higher-level methods for writing in a bare repository.

Bare repositories don't have indexes, so we have to rewrite almost all of the path-related operations.

Tests exist but are not committed yet.