I made a few minor changes to Kevin's last update (mobi_unpack_update3.zip from
post #255)... mostly some changes to the generation of the OPF file. There were a few things concerning metadata that were making epub checkers like Flightcrew bark a little bit.
Also removed some unnecessary Amazon specific attributes that were cluttering up the epub and generating warnings from epub validators.
Hopefully it's building a slightly cleaner epub now. The more KF8 content that gets unpacked, the sooner mobi_unpack can become more accurate/consistent.
I'm currently getting output that's nearly identical to the original source epub (minus the filenames of course).