Update the pre-build parser.
Optimise generalisation during type-checking.

This used an O(n^2) algorithm because it traversed every type in the
current environment every time it wanted to generalise the types.

The new version instead registers new type variables, meaning that
generalisation is now free.
Correctly check for ambiguous channels inside parameterised modules.