Command tests

Command tests refactored. Each command is in a separate commit to facilitate revision