Move the daemonize function to utils.py