Refactored code.
Refactoring and added ability to add subcommand info.
Improved type safety of parsing subcommand info.