Hacky initial implementation of bins and binning.  Completely untested at this point.