Simplify startup

This set of patches simplifies the startup of the daemon. In Linux systems it uses daemon(0,0) instead of the re-implementation to work with systemd.