rename textStateStack into `stateStack` (and add method to the TextState push and pop below)