new map code started in earnest

new map_utils function, starting the agonizing process of refactoring
the map code, to allow savegames, map switching, reduce side effects and
bugs, and allow more complex maps to be easily created and stored