semantic: Make replaceTraits more generic.
ir: Make TraitsExp.target a qname.