SPRT implementation

You can pull this patch. I've tested the functions separetely by feeding values and printing everything, checking the results in a spreadsheet. It seems correct. Anyway, I only modified stat_util.py, so there's no risk here (not plugged to the UI yet).