Fix #1121: Desugar of a Match does not transformExpr its selector.
Fix #994: IR check exports.

It turns out they were heavily IR-incorrect, hence the major
changes in GenJSExports.
Merge pull request #1122 from sjrd/ir-check-exports

IR check exports