Add default overriding of Flask's jsonencoder. Add json tests
Support older versions of MongoEngine