Israel and Hamas reach deal for a ceasefire in Gaza and a captive and prisoner exchange, sources tell Al Jazeera.