Add phpunit to require-dev section of composer.json
Handle detached HEAD state more correctly.

Repository::getBranches() no longer includes '(nobranch)' in this case.

Repository::getHead() now accepts an optional default branch, which
it will return if HEAD is detached *and* the default exists. Otherwise,
it returns the first existing branch.
Merge pull request #17 from NateEag/fix-get-branches

Fix fetching repo's branches when in detached HEAD state