Rewrote some of the internal spellchecker logic to make it more flexible.