Port Core -> GCode compiler to the monad, properly handling errors.