Updates API for Mongoid 4.
Fixes some dependencies.