fix serialization bug in VARCHAR

TERM char is also adjusted by sort-order mask. refactor mask logic
into its own method on VARCHAR. Order now provides cmp inversion
method.
Refactor randomization into it's own base class.