fixed wrong serialization of objects with default toString()

Objects that use the default toString() method will not create usefull serialized output so we make JSON out of them.
Also we now allow Arrays to be serialized to JSON this way too as the array datatype will not cover Arrays of objects with a default toString() method.