deserialization support for objects (custom and standard serialization)

I needed a way to deserialize objects in JS. This helped massively: http://www.phpinternalsbook.com/classes_objects/serialization.html

This might also address some of the issues raised around unserialize(), notably #109