initial commit of many-to-many relationship handling and associated changes