Refactoring - make CharIndex methods extensions of TextEditor.