server: correctly set debugging on if set in config file
Add daemonising capabilities, handle many more errors