q-vectorized percentile function

Based on seberg gist (https://gist.github.com/seberg/4966984)