Make program a daemon

Add code to make the program a daemon.  Add a config option to force the
program to stay in the foreground.  (Default is for it to be a daemon.)