serialize and deserialize a tree

Pre-order serialize a tree and then de-serialize it.