Fixed game loop

fixed loop to use requestAnimationFrame and added pollyfill