Ported library to libgit 0.19

Just some quick changes and all tests pass without issues.
If necessary I could probably publish and maintain the package on PECL.