collection of changes - code refactoring and style changes, extend 'list' command to output most internal data structures to stdout