Mongoid support

...seems to be working for me at the moment. Credits to @fabiotomio for most of this.