bring emscripten::val closer to the set of primitive operations provided by JS on values