Implemented daemonizing.

Also logs exceptions (useful for bugs when daemonizing instead of the
process unexpectedly quitting without any messages).

Added T in datefmt (logging) to enable whitespace delimiting on the
logfile.