Fix perturb to work with many pmfs at once.
Add unittest for perturb on many pmfs.