Fixes for Mozilla
Use requestAnimFrame and make animation independent of fps.