Backport of cfg-viewer.py from CMSSW_7_1_0_pre1.

Needed for automated tests.
Merge pull request #2289 from degano/cfg-viewer-to-62X

Misc cleanups -- Backport of cfg-viewer.py from CMSSW_7_1_0_pre1.