Fix docstrings in utils.text

Various cleanups to improve the built docs.