Added toJSON-Method to DynamicObject.