writing the tree straight out: write expects a file reference and string

encode turns the whole tree into one line, 186 characters long.
Here it is a node at a time, so that it fits the page:
  {"kind":"question","text":"Does it have fur?","yes":1,"no":2}
  {"kind":"answer","text":"a dog","yes":nothing,"no":nothing}
  {"kind":"answer","text":"a pigeon","yes":nothing,"no":nothing}

and decode turns it back: true
the dog's unasked question is still nothing: true
