Implement graceful shutdown on SIGINT

Close #21
Tidy up logging and add logfile support

To clarify, the initialization of logging has been cleaned up somewhat
and variable determining the logger's state are global: LogLevel,
LogFlags, and LogFile. Flags such as --debug and --file change modify
those global variables (such as `LogFlags |= log.Lshortfile` in the case
of --debug.) This will make them simpler to maintain.

Close #22