Refactor Histogram and Bucket

Also, be smarter about guessing resolution. Apply a 2x scale factor
so that resolution will not switch to YEAR until the sample interval
is greater than two years.