Refactor/blueprints

this does a pretty big refactor on the way we load the database into the app.

It also uses blueprints which makes it possible to write http request tests for the templates which is nice.