Add support for '--help' to print usage and 'help <cmd>'
Extract some of the logic for individual commands into separate funcs