Planned testimony by the former F.B.I. director reveals, in dramatic detail, the back story to Mr. Comey’s firing last month.