Added signal flipping support to Spike Detector

Saved waveform is not flipped anymore.
Also revised some analysis scripts.