Allow controller passing to notFound and error

This PR adds functionality to allow the user to pass a controller instead of a callable to ```notFound``` and ```error``` methods.

Adresses #741. Includes changes from #739.