Reformat code
Add some test cases for transport serialization