This includes updating the `Index.WriteTreeTo` test as it was abusing an
oversight of the object creation safety checks and creating a tree referencing
a non-existent blob. Instead we update it to the primary purpose of this method
which is to write into a repository from an unattached index.
An Object should be about representing a libgit2 object rather than
showing which methods it should support.
Change any return of Object to *Object and provide methods to convert
between this and the particular type.
Some test repositories are not correctly removed after the tests
did run. Fix by introducing a function that is to be used for
cleaning up temporary test repositories.