add cmdtype & general cleanup

cmdtype identifies commands within the messages received from scratch in
the form <type> "<message>" and locates there positioning to allow
splicing later. commands currently saved in a list <type> <location>
<message>
broadcast command fixed & cmdtype calls broadcast