Fixed game loop

fixed game loop to use requestAnimationFrame and added pollyfill