Add daemonising and PID file support.
(There are licensing issues here since the PID code is MIT)