Handled fftw_malloc failing. Added fftw_free.

Invoke garbage collector if fftw_malloc fails.
Panic if fftw_malloc still fails.
Added Free functions.
Added Dft functions.
Initialized arrays to zero.
Cleaned up some of the type casting.