Fix formatting in c code
Add unit tests of runningmeand; fix bug in runningmean revealed by the unit tests