Converted all functions to new write_csv function name.
Fixed the phase fit derivative method, it needed to be reduced by 2pi.  Also, I added a better guess to the sinusoid frequency calculation.
Corrected small style errors, and updated Derivative method to extrapolate back to the start of the waveform.