Added a template polyfill, and fixed issues with embedded document editing in IE.