Added template stubs and improved compatibility with flask-security