Functional rotate class by string reversal