A JavaScript implementation of the median-cut algorithm.