CMS-4754 Move relationship code into own module.