added emscripten main loop
removed dependencies on common/mtime.h
now it runs in firefox