Some refactoring of common code in the tests.
More tests for the factory methods of maps.  Some rearrangement of common routines.