cleaned up morphology extension, fixing some to_xml() write bugs and
changing the structure slightly of the SegmentClasses