Don't allow leading/trailing spaces in commands.

Trailing or leading whitespaces in commands
cause them to fail. For example "ls  " is an
invalid command. Show an error message to the user
when she tries to save such a command.
Merge pull request #314 from sahilm/no-leading-or-trailing-whitespaces-in-commands

Don't allow leading/trailing spaces in commands.