Add foreach-based jags parallel function.