Approximate Decomposition: A Method for Bounding and Estimating Probabilistic and Deterministic Queries