Fix #994: IR check exports.

It turns out they were heavily IR-incorrect, hence the major
changes in GenJSExports.