WIP clean-up in the import/export code

Ir_sync is almost there ...