Add error handler class

Feedback would be welcome on the code and also the sanity of the default levels. /cc @davidwindell @unstoppablecarl @lopezdonaque @staabm @stof