Refactor polyfill to work more closely with the recent spec and to use Skate templating.