hist: implement merge_bins method to merge arbitrary sets of bin windows