Added routine to rebin x1d files from CalCOS, minor changes.