Refactor some API

* Make RepositoryFileSystem constructor take Commit and not commit id
* Rename RepositoryDatabase.head -> RepositoryDatabase.headId
* Add parameterless commit method to Repository
Prevent double committing the same content in a row
Improve API