Properly implementing #toJSON method and other improvements.

Now it is possible to define a collection type for a relation, instead of defining a relatedModel.

It is also possible to pass a collection in a relation attribute when setting attributes. This will not override the existing collection when updating, nor store the given collection. The given collection is only used as an array of models.