Refactor parseCommand arguments with types

Accepts a state and command
Returns a state and output