Introduce a Map interface and changes the red-black tree module to use it.
There are complications with the map method which I have worked around in a somewhat type unsafe way.  More understanding is needed...