Misc cleanups of utils.py: ValueError to TypeError when checking for unicode string or byte string.  Move htmlentitydefs import to top of file.
Misc cleanups of utils.py: ValueError to TypeError when checking for unicode string or byte string.  Move htmlentitydefs import to top of file.

fedora-infra/kitchen,fedora-infra/kitchen