Implement SegmentDescriptor and associated tests.