Support factory pattern for creating apps

When doing

    assets_env = Environment()
    assets_env.init_app(app)

I get `RuntimeError: assets instance not bound to an application, and no application in current context`.