Fix contentType attribute logic
Cleanup and add StringUtil tests