New error templates

* Fix routes to work with url_for.
* New 500 error page and handler.
* New 404 error page and handler.

[ci skip]
Add better error pages.

*New 404 and 500 error handlers and templates.