Start using layout collection for styling ranges

This is only partially functional, but will apply basic styling from Span
elements onto sub-ranges of a text-block while properly heeding the splits of
different layouts.

Leaving old version of this code (TextBlockPainter#set_styles_from_segments)
for reference as implementation of all its functionality continues.