json dump in stdout implemented, see comments in code for a pretty print of the json format