Fix up to_ejson to work with newer mongoengines