A JSON serializer for mongoengine.