Cleanup and (mostly) document util/string.h and (very) minor refactoring

Updated: Incorporated feedback from 'kahrl'