Clean up some of the setTimeout() in the tests.

Some should be replaced with waitForComposite,
some should be replaced with requestAnimFrame,
some should use the timeout 0 instead of a positive value.
Verified: it works on Firefox.