Optimize more and add emscripten support