Fix for Bugzilla entries

Basic summary of logic error: It is possible for multiple RTF DTMs
to be pushed onto the stack between the start of a template and
return from it. I hadn't anticipated that, so my pop logic was

I'm still not 110% sure I understand the case where this situation
arises... I have a general intuition that it makes sense, but also a
suspicion that there might be a way to avoid creating one of these
DTMs. We should review that someday.

Meanwhile, this fixes a whole batch of related bugs.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68
1 file changed