Reorganized mid<->asm fns in Main

As part of a better commandline interface