Three-body model of deuteron breakup and stripping