Separated generation of word graph from path-finding code. A lot faster now.