Reorganised project, added command-line/config parsing and file logging.

We'll go with the split projects when they're actually useful. For now
this is easier to manage.