Remove TemplateCloser and better encapsulate templateIteratorTable

R=arv
BUG=

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