Move hook behavior into lib classes

This replaces the hooks with 1 line invocations to lib classes that perform the hook behavior. 

This also uses [rugged](https://github.com/libgit2/rugged) to get at the git stuff.