tree based deserialization
serialization can also be changed to use the tree internally
closes #1