Generalize format_mentions so it takes a string instead of a twet for wider reusability.