Add a helper to Container for retrieving document positions.
Refactored mechanism to update (cursor) positions after applying operations.