minor bug fixes in __init__ methods of TreeCPD and RuleCPD
adds to_tree_cpd method