Add json_response_for().

Builds an HttpResponse instance with appropriately serialized JSON depending on the request's Accept header.
Use json_response_for() in the easy cases.
Return a dict in tree_json(), pass it to json_response_for().
Use json_response_for() for jsonp generation, too.
Kill dumps(), replaced with json_response_for().