Fix MongoDbClient bugs

This branch fixes two bugs in `MongoDbClient`:

 - ClassCastExceptions raised due to the incorrect handling of field values returned by database queries in `read()`
 - MongoExceptions raised due to attempts to update the `_id` field value in `update()`