Four Israeli soldiers held by Hamas have been released and 200 Palestinian prisoners have been freed as part of a ceasefire deal that has brought an end to 15 months of brutal fighting in Gaza.