for http://stackoverflow.com/questions/16093940/how-to-modify-a-json-tree#16093940
clean up serialization logic
roundtrip test updated to cleaned up interface