Things needed for Pro Git 2

Also lots of other things. Longtime fixes and such. Sorry for this shitty pull request, I'm doin it live!