See my comment below about the possibility of splitting out the jsonable part of this PR from the simply pythonic access to a tree data structure part of this PR.  I don't want perfect to get in the way of good enough though ...