Major refactoring. New fft functions.