Ex 29: implement tree#fold, reimplement methods using it.

(Also, fix depth, which was wrong)