Better daemonization and improved logging