cleaning up toDigitsRev impl and improving doubleEveryOther algo