adds template() method to String.prototype and Function.prototype