Restructured DOM rendering
Refactored a bit so source code looks pretty
Added in error page
Whoops. Forgot closing brace.