Move cmdmap out of keymapper()