Need help with emscripten port

@brson yes probably, maybe some of it can even be generated by emscripten (was it the WebIDL binder maybe?)