Improved parsing of words: now the word parser shouldn't accept word
that has characters that are illegal in words (such as '[', ']'). Also
minor refactoring and changes to accomodate this overall change cleanly.