pytree: automatic branch type detection

Specifying the branch type is now optional in write_branch().
A little more work needs to be done for nested-vector support.

Also removed some old crufty example code.