Add some comments and basic serialization support