Improvements to mappings controller. Move array munging into a separate category...