refactored app

structured according to: https://www.digitalocean.com/community/tutorials/how-to-structure-large-flask-applications

Also roughly following PEP8 coding convention:
4 space indents
method names are like_this():
stuff automatically refactored by pycharm