Test runner added.
Some fixes
Make test emscripten compatible.