Improved exception handling

Added a general error page to catch any uncaught errors and improved
resilience by adding **kwargs to all of the pages.