Cleaned up some code

Removed silly attempt to detect errors in html and used status kwarg in render instead. Using the test client now so templates are rendered (in case there are jinja2 errors).

Did some other things for readability.