Make compatible with Mongoose 3.x (probably dropping compatibility for 2.x)