Extra features for standard library's cmd module.  (Major refactoring beginning with 0.7)