code cleanup and initial commit of json.go