Error handling improvements

* Add http_code attribute to MistError subclasses
  The mapping of MistError's to HTTP responses is now done
  in the exception's definition.
* Improve and clean up exception handler.
* Make exception handler gracefully handle generic exceptions too.