Optimized and *probably* working ops-to-histogram.

It's doing the correct thing on soffice -- maybe not on e.g. Opera? Lot quicker, since it doesn't iterate through all handles on ops and increases the live ones' hits.