Add calculation of arbitrary quantiles.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Improve quantile calculation

Quantile calculation now more closely follows the scipy implementation.

Added further test and documentation.

Refactored test helper functions.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>