A new imperative code monad, plus renames/cleanup