Schedule UI updates using requestAnimationFrame rather than setTimeout

Using requestAnimationFrame ensures the callback is executed prior to
the next redraw, eliminating undesirable & highly visible flickers for
UI updates.

Fixes issue #491.
Reduce UI flicker on FF as well

FF doesn't execute requestAnimationFrame requests before it's next
repaint, causing flickering when performing some types of updates
(e.g., recomputing Style2CSS). To workaround this, sometimes we force
animation callbacks to redraw ourselves at certain points.

This fixes issue #491 on Firefox
Merge pull request #496 from peitschie/ui-flicker

Reduce UI flicker when performing CSS updates