Implemented generic configure method.

This replaces the old system, where providing an error handler to the middleware
would return a new middleware using that error handler. This was considered to
be confusing behaviour, and not really usefull as the assumption is you only
want to use a single error handler within a project anyway.