Move app out from __init__.py (#1425)