Hamas and Fatah, two factions that have been at odds for seven years, say they will form a new unity government.