Lots of fixes to test framework for Firefox.

Merge https://github.com/web-animations/web-animations-js/pull/364 and https://github.com/web-animations/web-animations-js/pull/365 first!