Add a monad to let input handlers access MVars but not do anything else.
Make InputHandlers be in the WithMemory monad.