Add a function to truncate strings if they're longer than certain number of characters. If it splits in the middle of a word it will truncate to the end of the previous word