Revert to using git to find current branch

This reverts commits 9143ff134d72218433010d2df678aa4989632fd8 & 747be384605c710e6857d5fe33c29f98c6c5bb64.

There was a bug in the file handling one, in that if you descended into a git repo lower than the root containing ~/.git, you ended up with "no branch" instead of the current branch. Git figures this out just fine for us, so revert to previous behaviour.