Redesigned lexer to use fewer class variables directly.
Now uses nextSymbol() instead of analyse() to get one token at a time.