Prevents Error "Converting circular structure to JSON" while sending models to socket

In some cases a model can have a circular structure through associations.
bugfix to previous commit
using toJSON instead of toObj now
Merge pull request #440 from der-On/patch-4

Prevents Error "Converting circular structure to JSON" while sending mod...