Add tests for JSON warnings containing metadata.
Add documentation for --json-err flag and JSON error and warning formats.