Move model relationship methods into a trait.