Actually use the custom codec for mongo where we can plus some other updates
Add count and replace operations for mongo, rename delete to remove to be more consistent with mongo.