Minor code cleanup.
Added simple JSON output format.