Converted the code to use the switch cases for commands, and created the
handle object so the functions will work from there.