BUG: Rework repository constructor so it can throw exceptions

Repository was being created and when an exception occurred
it would hog all of the exceptions for it self. This
would cause any client of this code to not know that
a repository was loaded correctly.
Added GitTopLevelDirectory

This is a helper function so it when opening a git repo
from not the top level directory we know where we are in
the directory hierarchy.
Added some tests for repository.

Not exhaustive tests but they are a start. They all pass.