CLEANUP: Split JSON support into HTTP and non-HTTP parts.