[DO NOT MERGE] [WIP] fixes #7496 - change has_and_belongs_to_many to has_many :through and add unique validation and auditing to join table