#785: svm_json.py, consolidate logic