Changed the model lookup to refect the actual model database.

Mongoosejs supports multiple connections, hense the use of the actual
db object in the model structure to lookup the model types.