Generalized Weighted Model Counting: An Efficient Monte-Carlo Meta-Algorithm