Fixed more bugs, in printing constraints and connecting initial constraints
Rewrote substitute-typevars to perform better (also resulting in nicer graphs).
Found/fixed some bugs on the way.