Encode index keys in MongoDB storage layer not WiredTiger for indexes.

This makes performance much better. I suspect quite a lot of this could
be improved if we cache cursors more effectively.

Also re-enable document level locking.

Patch from Eliot Horowitz (thanks!)