Almost done, finishing logging and pthreads
Broke things. Daemonizing isnt working anymore