Optimization of rightmost boundary and bug fixes.

Optimized the right-most boundary for poisson integration. Additionally,
removed unused functions and redundant lines. One bug removed. Added
additional sanity checks to p-value and zscore calculations to eliminate
false positives due to 0 variance of null distribution or the D value
being 0.