simulator: Use C wrapping in Emscripten to be Chrome-compatible (no eval)