Added middleware to remove trailing slashes on urls
Fixed jinja2 template caching in debug mode
Moved logic out of routes into models