Preparing a lot of stuff for the eventual implementation of a map editor
More mapping related fixes