Move branch lookup to GTRepository and clean up its API

Lookup is now performed by _branch_ name, not _reference_ name.