major cleanup of tsig datastructures and extend/merge operations; fixes old bugs in classes/arities code; proper treatment of nonterminals and syntax-only types;
types 'v binop = 'v => 'v => 'v
datatype ('a,'v) expr = Cex 'v
| Vex 'a
| Bex ('v binop) (('a,'v) expr) (('a,'v) expr)