Split spectralpipe IDL code into subroutines.

I also attempted to fix the flag_broad_rfi FFT wavy baseline
detection code.  It works on one test dataset.  I need to check it
on others.