Move cons_type to types.ml
Implement infer_instance