Emscripten: use less JavaScript