Add reverse_part, replace each_permutation, add tests