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