Make refs support submodules

In a submodule the git_dir is actually a file which contains the location of the actual git dir in the format gitdir: my/actual/dir.

I've already verified manually that it solves my issue (https://github.com/aanand/git-up/issues/31) but I'm quite new to ruby and grit so I could use some advice on how to write the unit tests.