Define custom Eq instance for Type to deal with qualified types.
Finish inferExpr and inferValueDef.