Improve coref context collection and change type parameter of CorefResolved to a type bound.