Truly fix #584, refactor a bit command parsing

Use precmd() method instead of adding our own layer of preprocessing