Hamas has agreed to free 21-year-old American-Israeli Edan Alexander as second stage ceasefire talks look set to progress.