Update to reflect changes in emscripten.
This also cleans up the testing code a bit.