Adds unit test and makes minor changes to the rebin_cube_hdu function