Use TreeMap's ord implementation for Json

Closes #4430