Make daemonizing optional

Introduce command line argument parsing, add a single --foreground
option so we can keep the daemon on the foreground for development.