Defaults format to json if content-type header says so

(Yeah, you're getting kind of a wall of pull-requests at the moment.  Sorry...)