Remove outerDocument implementation. I think it's fine for ref to only work when the template is in the main document.

BUG=None

Review URL: https://codereview.appspot.com/7130048