I think Al-Quaeda lost the initiative when the US followed up by invading Iraq rather than just sticking to a "war on terror" by chasing them out of Afghanistan, and other police/security measures as advocated by most of the foreign policy establishment.
Hamas has never had anything to do with them and any surprise at this from drink soaked trots has more to do with their zionist illusions than with any new development.
The Sunni tribal militants turning on them is much more significant and marks their effective end in Iraq with major implications elsewhere. In itself this won't end the insurgency since the tribalists can still keep attacking both US forces and Iraqi infrastructure (oil, electricity) etc in an attempt to force concessions. But by rejecting the goal of stirring up a civil war with the Shia they are also rejecting any possible strategy for mobilizing most Sunni to support the insurgency and implicitly accepting that the insurgency will end with a political settlement acceptable to the Shia as well as the Sunnis. This in turn makes the insurgency pointless in the long term and joining the democratic political process increasingly attractive.
That too was inevitable once the Sunni tribalists grasped the fact the suppression of the Baath party and army and establishment of a democratically based Iraqi state mades it impossible to establish a traditional Sunni dominated autocracy again because both the Kurds and Shia could fight from a majority position against a minority that no longer had a monopoly on the means of violence.
However unlike the Hamas position, that inevitability has only manifested itself recently whereas the stance taken by the opposition to the war still held out the hope of re-establishing a Sunni autocracy for a long time - since all opponents of the Bushies and many supporters were unanimous in agreeing that suppressing the Baath and its armed forces was a "huge mistake".
It was from the point of view of a "war on terror" since it resulted in the "diversion" of having to fight an insurgency aimed at restoring Sunni domination that would never have occurred if the US had really only fought to "disarm Sadaam" rather than to establish a democracy in Iraq.
But it was no mistake from the point of view of a policy aimed at "draining the swamps" as the only long term solution to the problem of terrorism.
What remains a problem is that the ruling class is so counter revolutionary its "opinion leaders" still just don't "get it".