src: move JSONWriter into its own file
The JSONWriter feature is not inherently related to the report feature in any way.
As a drive-by fix, remove a number of unused header includes.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines