Working cumulative histogram, as long as data fits into a single workgroup.
Working scan for larger histograms, removed some debug code.