dirTerminalType: fixed for IE

It was not working in IE. Turns out this was due to the fact that I used
customer properties added to DOM nodes to store the text data. This was
a bad idea, even though it made the code relatively simple. The work
around is a bit horrible, but at least it works.