Compatibility layer for requestAnimationFrame

If your libraries aren't already handling this, please include the code
snippet added here to that it work. Safari is the main cuprit at this
point.