Chi squared

I have fixed a couple of bugs but also added extra documentation and tests and fixed the ``Signal.estimate_poissonian_noise_variance`` method that was broken. I should have done some of these things in another branch, sorry for that.