Add count_words for CLI use