Famous/core — pull request #54 by malandrew (2014-06-28 02:03:30+00:00)
Title: Improved engine run loop, enable/disable methods and deregisterContext

This pull requests makes a number of improvements to the Engine module.

First, this takes advantage of the hi-resolution timer available in modern browsers.
http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision

It also makes use of `requestID` returned by `requestAnimationFrame` and `cancelAnimationFrame`. This eliminates the need to maintain a `runLoop` flag and check that flag on every loop. This allows the call stack for `rAF` to be reduced to a single function call.

This change will require an updated requestAnimationFrame shim, which I can add to Famous/polyfills if these changes are accepted.

The Engine now has `enable` and `disable` methods for turning the `rAF` loop on and off. This is a better API than setting an option.

The `step` function now allows you to give it a set number of frames to advance. This is useful for testing and debugging purposes.

Lastly, there is `deregisterContext` method that removes a context from being evaluated by the `rAF` loop.

I would appreciate it if others would double check my work here, trying it out in their apps, to see if everything works correctly (since we don't yet have a test suite) and comment on these changes.