Add support for exporting to JSON with the "-t json" target flag