Add ClusterMapTest and make a number of changes to ClusterMap to improve code quality