Cleaned up more main code

Replaced all instances of cmd with cmdHead.
Replaced delim with 0 to fake multiple strings in single memory space.