Implement serializing of import and export sections.