refactor logging again, this time to support easy plain-text mode, and to have all logging through a central point again
minor tweaks, document