Implemented a copy-on-write map.