Refactor tests to allow injection of the formatter.

Also broke up a few tests around the writing results and resetting the
formatter.
Add tests for all notifications.