Revert "template ref should check treeScope.getElementById"

Accidentally committed to stable rather than master.

This reverts commit 7d8ad995d62a088c63c2e12f3488a45b103cfb85.