Plainprogrammer feature mongoid4

4.0.0 support, with changes, from #1