Support more opcodes in JavaScript generation
Apply peephole optimizations on port out/in