SpanExpression class: implementation and tests.