After months of deadlock, Israel and the militant group Hamas reached a fresh Gaza ceasefire and hostage release agreement.