Controller undo stack fixes; also detect indent level with js