Merge #traits and #trait_references methods
Inline traits by replacing trait references.
Merge #type and #type_reference methods
Inline resource type references with resource types.