Mongoid 3

Add support for Mongoid 3.
Maintains backwards compatibility with Mongoid 2.