Daemon, simple file logging, etc

I'm a bit unsure about the Queue.h change, but it's the only one not resulting in segfault I've tried yet.
Added daemon mode, a really simple redirect of stdout to file for file logging and signal catching for reloading of config (SIGHUP) and shutdown signals.