Add ability to set and add associations by model id instead of model instance

Closes #1479