parse and handle commands
tests for parsing and handling commands