Reorganize flask application.

This will clean up the general structure of the
application and thus make development easier.