Change 'TextSpan' to be a simple record type with free floating functions.