I'm adding my working version of spikefinder

This one has a loop within the function and actually stops when there
aren't anymore spikes.  I changed the data into a constant and a varying
portion, effectively removing the threshold definition from the loop.