Do not crash when a repo has a detached HEAD

Instead, we select a default branch - master by default, but the default
branch can be configured using config.ini.

Note that if the default branch does not exist in a repo, that should
not cause any issues.

Also adds phpunit to composer.json's require-dev section.

This depends on a PR for gitter - composer.json currently points at my fork, and I updated composer.lock so the commit would be internally consistent. I'm guessing you won't want to merge a commit that relies on a fork - what's the best way to handle this?

I updated the tests, too - they're not extensive, but by creating a repo in a detached HEAD state, we verify that the front page does not crash, so it gives us something.

This fixes #252.