Mocking JS's withAnimationFrame
Removing one layer of fn nesting