de-duplicate command parsing code
Merge pull request #10 from eponymous/master

De-duplicate comand parsing code