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 remote-tracking branch 'sahil/no-leading-or-trailing-whitespaces-in-commands' into sahil-no-leading-or-trailing-whitespaces-in-commands