Get rid of global variable in JSON->YAML conversion

The best way to deal with the lack of proper closures in Python 2 (Python
3 has the nonlocal keyword to handle this) is to wrap the object in a list
and manipulate the first list element instead. In this case, though, even
that is not necessary.

Change-Id: Iac6d95a66b1bfc6fd409851bf6c918629a98335f
Merge "Get rid of global variable in JSON->YAML conversion"