Refactor to hmt - [#69540418]

Change habtm to has_many :through for events and organizations for more easily maintainable code.