various changes to core class and base model to improve saving and removing many-to-many pivot items using multiple select