Support for parsing commands with spaces

This PR is based (and credited where due) on https://github.com/meebey/smuxi/pull/121