Stable Model Counting and Its Application in Probabilistic Logic Programming