better comments
The DEBUG token appeared to be clashing with something during error handler shutdown. renamed it.
Added a shutdown feature so that things can be closed up outside the error handlers in a more consistent state