Basic JS game engine.