lib: cosmetics at command.c

Extend command framework to support logger and remove some dead code.
some cosmetics too.