Updated comments for data contracts

Other changes
- Minor cleanup to contract tests
- Fixed child module import on Python 3.x
- Handle serialization of optional values better