Emscripten

Fixed a bunch of stuff which made Emscripten build fail.

Fixed warnings when building unit tests.