More consistency checking on inference constraints

Also added a test for simple interactive type inference