add datatype environment, not using yet
update tc to use datatype env, report better errors on cases mismatches