add a binomial confidence interval. refactor some. add parameters and docs.