added testing function. Got middle/train better

the testing is a convenient script wich will characterize how many zeros
there are, and plot a histogram.
The middle/train successfully crashes together and explodes, but all
spike versions seem to produce to low number of zeros.
fixed bugs in tests