mk_vartype_thm now needs a STATE hypothesis

since type_ok now requires a good context