My slightly-educated opinion on the matter is to please try to emulate the current "real" KePubs as closely as possible

Ignore what's in the JS and CSS files and build the KePub structure based on observations of a few Kobo-supplied books. I didn't necessary do that at first and it resulted in a lot of avoidable problems.
EDIT: As for JS and CSS files, try to use the mechanism I'm using for "reference.kepub.epub" or (probably better) work with the existing code for sending a device-based CSS file. You could easily add code to do the same for JS files.