hist: implement merge_bins method to merge arbitrary sets of bin windows
unit tests for merge_bins, overflow, and underflow