Detect line endings when wrapping occurs between elements

Line ending detection was relying on wrapping occurring near or in a block
of collapsed whitespace. When wrapping occurs between two elements, both
previous and next rectangles may be defined, though the vertical overlap
will be absent.
Add tests demonstrating remaining line ending detection flaws

Line ending detection is still not stable when the wrap point doesn't
span a cursor position (as happens when the wrap occurs over
whitespace). Fixing this issue is not easy, so these tests demonstrate
the current bad behaviour so at least it is somewhat documented.
Add changelog entry
Merge pull request #774 from peitschie/line-scan-fix

Detect line endings when wrapping occurs between elements