Add a function to calculate the percentile rank of a value in an array.

Tried to use the Google code style guide, but no doubt something slipped through.