Updates to the map editor. Also some cleanup.