Main loop works in emscripten
Proper frame loop delay