On error, display pretty pages for 400 and 404 errors

- Have to use layout: "error_page" otherwise it doesn't render without
  the login part of the heading.
- Reindent some of the return statements.