Span

Addresses Issue #297.

Also includes some refactoring of TextBlockPainter.