Implement joint probability for an arbitrary query Q|E in the dag.
Implement joint probability for an arbitrary query Q|E in the dag.

The previous implementation of the estimation was incorrect. In
particular, the new method is to compute P(Q,E)/P(E) where the
numerator and denominator are seperately evaluated. First, one pass
is made on weighted_sample, and the likelihood of the query is the
sample weight, which are averaged. Another pass for the normalizing
term P(E) is performed -- note that the samples from the first pass
cannot be used in general. Constraining nodes at values Q in the
first pass restricts downstream nodes, which means the full density
surface of E may not be explored in the first computation.

probcomp/bdbcontrib,probcomp/bdbcontrib