Set up permutation testing as a separate function.
Permutation testing now runs using a multiprocessing pool.
Added a shared counter for tracking the number of completed permutations.
Merge branch 'permutation-multiprocessing'