Add common text formatting helpers

This look right, @timriley?