Separated command handling into new Class

This is a major re-write, which separates the string tokenising, form
the handling of command, this allows the command handling to be multi
level, i.e. recursive