Add Mongoid 4 compatibility and add deprecatio warning