add options to write out json data

Needed this at a recent hackathon, thought it might be useful to add to the tool :)