Add documentation to serialization. Fix typo in idport.py.