Refactor logging

When trying to debug agent problems on a machine not under my control, it's hard to pin point problems. I'm going to add a significant amount of calls to `Logger.Debug` about the place, so when a problem occurs, I'll have decent debug output.