fixed constraints for If

previously, generated mutually recursive constraints for branches of If,
now generate just two constraints relating each branch to whole
added support for recursive definitions (Rec)

successfully typechecks `map`, but fails with `reduce`
fixed problem where var bound to itself in substitution caused conflict

when unifying constraints, if both sides of a constraint are the same
ty var, the constraint should be discarded, not added to the
substitution, since adding it causes trouble later