Work-in-progress type system foundation.

Modelling type constructors and types in preparation for implementing
type inference. There's a bug (probably actually a design flaw) in how
unification is handled which causes infinite recursion in some cases.
That will have to be fixed another day, though.