Added command handling, still needs tab stripping but otherwise done