Rex estimate binning; code reorganization

Plotting not working properly yet