Make the Git backend a bit more convenient to use.

- Properly initialise the HEAD reference
- Allow to expand the filesystem and build the cache file on every commit (will be a bit slow, though, but convenient to use and debug)
Add a basic example on how to use the Git backend in a library