Refactor foreground processes to be a subclass of daemon
Add IO redirection to the log file for foreground processes