fixed index error caused by miscalculating max iterations. fixed repeateveryuntil to be deterministic.
Merge pull request #97 from cloudfoundry-incubator/max_iterations_calc_fix

fixed index error in percentile calculations fixed repeateveryuntil to be deterministc