Big changes to logging. Everything should be much cleaner.