Adds support for Flask's "app factory" pattern.