MapDefinition code cleanup and unit test update