(#22363) Refactor Type system, add Enum, Regexp, and Variant

This changes the existing Pattern class to Regexp, and introduces
a new Pattern class to describe a subset of strings based on
a regular expression. An Enum type descriebs the set of strings
equal to one of its values. A Variant type is disjoint set of types
that describes instance of one of its types.

The type calculator tests have been refactored for better
maintainability.

The operation [] on a (old) Pattern type, now Regexp) was changed
to not produce an instance of Regexp, instead Regexp[s] produces a
narrow type that can be used instead of a regular expression in matches.