Use a predefined RMap type

This yields better performance, and easier extension of the supported
interfaces.
Locking on key instead of entire map