constants moved to __init__.py
app created in a function instead of as a variable