change tree node property to a method

changed tree node property to a method, and added a set_node method
(following the model of prob/set_prob etc in probability.py)