JSON to CSV

Convert JSON to CSV with automatic header detection.

Provided JSON is not valid.