Small cleanup to cursor insertion logic

Don't need to walk through each sibling to find the correct offset.
Extract TextPositionFilter into standalone class for easier tuning and testing
Extract StepsTranslator interface to allow a safe interface to start caching improvements
Added signals necessary to keep a caching implementation in sync with the document
Added first elements of a caching steps impl
Cache regex for grouping element