serialize and deserialize javascript object, preserve your object model