Additional refactoring.

* Make commonWords a set
* Use `with` when reading from files
* Move text parsing into a `parseText` function.