Refactored Perm to have a fast implementation for size=2. Using now an Array[Short] to store the permutation image.