Cleaned up some of the background process code and organized logging much better.