Fundamental Algorithms for Permutation Groups