Begin rewrite to use emitInstruction, much cleanup.
Monad improvements