Refactor/blueprints

this does a pretty big refactor on the way we load the database into the app.

It now uses flask blueprints, making it possible to write http request tests for the templates as well as creating more modular code.

It would be nice to figure out a better way to pull the database object into the current app without having to reference current_app.mongo.db (prefer mongo.db or just db!)