Add a non-decorator version of the error handler register function

The main application object has a register_error_handler function
which mirrors the decorator's functionality. According to the principle
of least surprise, make sure blueprints also have this convenience function.
Add tests for user-defined exceptions in blueprints
Merge pull request #859 from wvh/register_error_handler

Add a non-decorator version of the error handler register function