add factory method to get extension state from flask app.

And remove the binding of extension state and the app.
decouple remote apps from the ext state.
remove config_prefix (and use app.name instead).
add session class.