needed to change the code as it turned out to be very slow. In exact,
Tag.isValid() was called for every character to remove scripts from
being passed to processTokens. Sometimes script code slips through as
words - need to inspect why or on what circumstances this occurs.