This should be made pluggable: we will switch to a different JSON format soon, and it would be good if you could just swap in one or the other JSON handler depending on what format is used.