Moved RequestAnimationFrame and handling of it to helpers.js