Added support for making it run as a daemon and for creating a pidfile

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>