Discard lots of code. Turns out libgit2 already has a function for that.
Get rid of the git_branch_iterators.

Turns out libgit2 also has a function to detect detached heads, which
solves the problems I had with git_repository_head earlier on.
Getters are const
* Remove the default constructor. It's pretty useless.
* Add a destructor to clean up libgit2 state.
Fix memory leak