complete re-implementation of the sub-commands system.