Return arrays by const ref.  No copies.

Each and every time you were getting words via `getWords()` you were copying and then destroying the entire array.  This was even happening when you use `getWords().size()` ... a full copy.

After profiling, I found that 60% of your program's time was spent on this copy / destruction.  Returning by const reference prevents this copy from happening by providing a direct read-only reference to the underlying vector.