Implement custom raf module to avoid sinon breaking timeouts.