Add word count functions

Add function to count all words and a function to only count the words
that occur at the end of a sentence.