Various optimizations.

* Strip whitespace.
* Don’t request word which is longer than 40.
* Deal with Unicode correctly.