[INTERNAL] IDPosteriorErrorProbability code clean-up (primarily iterators)