how does PackageArchive work?

This is certainly doable. Python allows you to replace the implementation of import with a function of your own design.

There is already a tool–try googling SqueezeTool–that does this for zip files. It wouldn’t be hard to extend it or use the same concept to do the same thing for .mf files.

David