Make NameResolver resolve trait alias and precedence names

This PR implements name resolving for alias / precedence definitions in trait adaption.