Adding factory support for mongoengine (Closes #89).