WIP emscripten rework [skip ci]