Remove some more TestMain references.

Rework how Logger/ErrorManager interact so they can be half
mocked out (or, at least, used in a thread-safe-ish manner).

Change-Id: Ia5899640bdc101793819dab88c3fe6038a759abb
Reviewed-on: http://gerrit.dmdirc.com/2695
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager