Improved the text utils to be much more robust and handle classes better.
Rename text.py to text_utils.py
Quick and dirty commit to demonstrate recent changes.

Will revert and split into proper commits.