Allow sync() to specify $attributes per id

This is a more robust implementation of https://github.com/laravel/laravel/pull/1424

Eloquent's Has_Many_And_Belongs_To->sync() accepts either a flat array of IDs, or an associative array of $id->$attributes, where $attributes is itself an associative array of attributes to apply to the pivot table.