Use the chosen_words[] index also for the wg path.

This is possible now that we don't have empty words in chosen_words[].
Also use WordIdx instead of size_t;