Array attribute relations

took #3918 and added tests for elasticsearch.
Tests are only failing because of #4379.

@qiangxue what do you think? Imo this is good to merge.

fixes #1249, closes #3918, fixes #4379
btw, @qiangxue: shouldn't we add the attributes parameter to save() and only update the attributes that need to be saved for the linking?