Replaces the internal inheritance + unique_ptr scheme to a flat sum type similar scheme that uses a tag to determine which operations are legal, rather than using the indirection itself as a tag.