Add some unit tests for ErrorReporter.
Fix failures caused by static factory.

Can't register it separately for each test, as it'll just end up
using the first one. And the API doesn't let you remove factories :(
Merge pull request #82 from csmith/master

Add some unit tests for ErrorReporter.