pylal upper limit codes: refactor and add HPD functions

remove trapezoidal integration element to its own function,
rename the minimum width interval, add Highest Posterior Density
interval calculation.  Unit tests are passed as before