Flask application

Introduces flask application architecture.

Recreates #23 with recent changes incorporated.