implement receive_from_sideband
implement receive packfile

not happy with the error handling and the control flow in
receive with sideband, but it works.