update requestAnimationFrame detection. Also closes #1.

Remove a loop and swapped it with the [MDN detection solution](https://developer.mozilla.org/en-US/docs/Web/API/Window.cancelAnimationFrame#Examples). Also added a missing semicolon.