Further SegmentVariant refactoring

    This changes the SV implementations to expose text and code "atoms",
    which are then manipulated by common code in BaseSegmentVariant.

    This includes the replaceSelection() method, which isn't used
    anywhere and is intended to be part of copy/paste support.
Merge pull request #4 from tingley/atoms

Further SegmentVariant refactoring