Reinstated John Resig's templating code.

Reinstated John Resig's templating code after changes were made to the
Chrome extension security.