Fix var type inference2

Giving it another try.
You will have to look at the comments in the entire file.
Basically, I'm trying to move all the ambiguities at the top, and get the list of all possible constraints for variables.
I'm not actually removing sharing, I'm collecting only the constraints for each variable.
That clone is done each time I need to create a new set of constraints.
Please tell me if I should be more descriptive.