fft implementation is sub-optimal

@sbhatta said he has old code that implements a better FFT function. He'll look for it and patch it up.

@pkorshunov as interested party to coordinate and make sure the tests pass afterwards.