(#11331) Refactor position on line calculation, add tests.

There was one remaining case of position calculation that was wrong;
whwn strings contained embedded newlines, the following parts of
an interpolated string would all be positioned relative the start of
the string (as if newlines did not exist).

This was further complicated because position of the string part
with newlines should remain positioned at its start offset, while
the end may be on a different line.

Rather than keeping track of two line offsets (for the start and
the end offset), a refactored solution instead pre-computes an
index of all line breaks. It is then easy to calculate the line number,
position on line for any offset at any time.

A test is also added with an example of an interpolated string
with embedded line breaks.