Uncaught exceptions are now logged as critical

Previously all errors and messages was logged at the default level,
which is 'error'. Now uncaught exceptions are logged at the 'critical'
level
Code cleanup
Centralized logging
More generalized mocking of console output during tests