Added primaryAttributes to model prototype
Modifying setting to behave like `fromJson()` when setting a value with a plain Object and the attribute`s type is defined.