improved the daemon.
Implemented sort of logginf and stdout and stderr redirection to files for the daemon.