Reorganization of JSON validation code and tests