Added logger and catching of SIGTERM when in daemon-mode