Add normalizeCycle method to recude number cycles

cycles are found multiple times (all their permutations). normalizeCycle rotates the cycle, so all permutations can be normalized to one representing cycle.

Add testcases for normalizeCycle
getAllCycles uses normalizeCycle

belongs to #17
more testcases for #17
several fixes for #17