Add mock keystore.
Add missing imports for flask helpers.