Wrap rAF for testing do that we can catch errors and prevent them hitting the test runner