Test json output using grep

This avoids differences in whitespace (e.g., Python 3.3 seems to include
trailing whitespace in the json).