Pull out json testing code.