Posting v5 updates of pg_import_rel_stats() and pg_import_ext_stats(), which address many of the concerns listed earlier.
Leaving the export/import scripts off for the time being, as they haven't changed and the next likely change is to fold them into pg_dump.