cli: allow one character commands

A bug in trim_and_validate() disallowed one character commands. At the
same time, change to use isspace() instead of checking for whitespace
characters manually.
cli: disallow adding invalid commands

cli_add_cmd() never called the same trim_and_validate() function as
cli_run_cmd() did. It was therefore possible to add a command that could
subsequently not be run, which is probably a bad idea. Disallow it by
running the same input validation in cli_add_cmd() and in cli_run_cmd().
cli: refactor cli_run_cmd()

This fixes multiple issues:

	- constant parameters are declared const
	- multiple spaces allowed
	- general cleanup
	- no stack allocation; arbitrary command lengths allowed
test: add cli_test

While there are tests for the stringtree implementation, there were no
tests for the cli abstraction layer on top of stringtree. As some bugs
had crept into this layer over time, this was evidently not enough.

Add some simple tests for the cli layer to avoid this in the future.