Adding daemon mode.

Implementing daemon mode using daemon the module. Requires lockfile
module. Imported only when needed for compatibility with existing
installations which are unlikely to have the Debian python-daemon and
python-module packages installed.