added static toStdClass for easy conversion of any object into a format that is easily serialized or json encoded