Restructuring TerritoriesMap class using HashMaps.
Changed all classes interacting with a TerritoriesMap to reflect the changes made above.