Implemented serialiazation of stdClass (untested)