Fixes bug in regards to empty git repos

 - When a `ref` file exists but contains an invalid ref to `heads/master`, the repository is (most likely) still in an initial-commit phase. Added check to account for this scenario.
Adds test for bug fix in regards to empty git repos.
Adds hackish solution for finding the project root.
Merge branch 'release/0.1.3'