This changes the trait encoding scheme to also use the generic encoding from !56 (merged) in order to handle type parameters and lifetime parameters of traits and trait impls correctly.
Along the way, this makes some more changes, such as:
FunctionSpec
so that we can intern it and create referencesAlias
There are some things missing that will be fixed in a future MR: