first stab at JSON output

Not quite right, but took shot at it to make it work.