Fixed a bug where the log file was accidentally hardcoded. Added initial daemonisation code.