Branch detetion no longer relies on git.exe beeing on the path

I've simplified the branch detector to not rely on git.exe to make it work more seamlessly on buildservers like TeamCity