Rewrote the console UI to use StateT.