count_tokens function

Count the number of tokens in a text string