This adds initial support for traits.
Missing features:
These features will be handled in future MRs.