Reliably splits the different commands provided that the syntax is correct.

Modified make_command_stream; added the auxiliary functions
set_command_type, generate_command. Need to re-add -Werror flag in
makefile after we’re done.