Initial implementation of a windowed percentile

Should be possible to optimize much more by doing only a single sort up
front and computing percentiles relative to it
Set write flag for in-place updating