Fixed #6668 -- Optimized utils.text wrap function

This fixes a failing test after applying an optimization of the
utils.text.wrap function by user SmileyChris.
Moved wordwrap test to their own function

The `wordwrap` tests were in the `test_wordcount()` method for some
reason. This moves them to their own method, and make consistent use of
double quotes where needed.