chistedit: move changemode() onto state class
Differential Revision: https://phab.mercurial-scm.org/D11644