jsoncheck: split process_one_file from main

blueprint modularize-doctest

This patch moves most of the code from checkjson's main into a new
function process_file. External users of the module will have their
own filesystem walker, they just use the module to check/format a file
of interest.

Change-Id: I510b5d3d5ea20d2c0a694ef3401eb9fafc15bed4
Merge "jsoncheck: split process_one_file from main"