Rework logging system.

This PR retools the logging system to use categories, so that logs from different components can be differentiated and set to different verbosities.

Additionally, I have rephrased most of the MD logs to be less confusing/ugly.