Major optimizations to Map::clean

Over 130x speedup