Add initial support for JSON output.