Refactor string functions, fix many defects.

Since ResponseType is an uint8_t not an enum, it may be out of range if something went badly wrong. This catches that case and transforms it to an RDM invalid response.