Counts the words in a string of text