Fixing generator, third attempt.

This needs https://github.com/web-animations/web-animations-js/pull/293 to be merged before this one.

This uses code from the first fixing attempt but instead uses direct function calls rather than postMessage. It also fixed the "load" button to work (which never worked in the original fixing attempt).