Added support for becoming a daemon