Formatting and basic tests.
Make it easier to redirect the output.

This also, consequently, makes it easier to test the module. No more patching.
Yay!