Refactor traversing functions
Undoable text inserts