Direct commands now work

Finished the direct command handler and the functions to allow replying
to direct commands. Now I need to write the passive command handler.