Added daemonizing and signal handling closes #9

Main function now daemonizes itself
Sigalhandling for SIGTERM was introduced
Added documentation for functions