Remove 2+ repeated word occurrences in preprocess

And also move these steps to after encoding.