The Sunni-Shia split doesn't make much sense if the Abbasids invented Islam. Conventional history says that the Abbasids work with the Shia, emphasizing that they were descendants of Muhammad, then turned against the Shia and began persecuting them. If there were no Shia how could the Abbasids be appealing to them? More importantly, why invent two branches of Islam in the first place? Why would the Abbasids invent divisions in their new religion, which would give their enemies justification to overthrow them? It also doesn't explain the Ibadis, who first came into being during the Umayyad period.
The split between Shia and Sunni happened AFTER the Abbasid revolution, not before. But it was thereafter backdated, along with the whole history of the movement.
The Muhammad story was probably invented by preacher "Abu Muslim" in Khurasan, a place very far away from the centre of the Arab hegemony and therefore conducive to the invention of an alternative myth about its origin.
Seeing that the Abu Muslim movement was sucessful in Iran and that its army was nearing the Tigris river from the East some powerful disgruntled Mesopotamian Arab clans then decided to throw in their lot with the rebels and try their luck at an anti-Umayyad revolt (it was certainly not the first time such an attempt was made) The Alids and the Abbassids would have been 2 of those clans, and among the most prominent of them. Since the rallying myth of the Abu Muslim movement was the story of the Arab prophet Muhammad from Mecca, either the Alids or the Abbasids, or probably both, then negociated with Abu Muslim that, as a price for their support, a fictitious family relationship would be fabricated between them and the "prophet's family" in order to justify their prominence as allies. This is standard tribal politics and the same kind of thing was still happening on a regular basis in Africa or New Guinea in the XIXth century: when two tribes wanted to forge an alliance they "discovered" themselves a common ancestor
et voilà, they became "brothers".
All was well untill a dispute occured between the Alids and the Abbassids, probably just after their common victory over the Umayyads. Given that the Alids had been granted a more senior family tie to the prophet's family (through his only daughter), compared to the Abbasids, it is likely that the Alids were originally the dominant partner in the alliance with the Abu Muslim movement. However, for some reason, the Abbasids managed to upset this position and become ascendant in their own right. They eventually cut the Alids from power completely, confined them in their traditional fiefdom of lower Mesopotamia and eventually drove their supporters underground.
This story of alliance and betrayal occurred in the 750s AD but when the official histories were written, at the end of the VIIIth century, it was backdated to the 650s to make it coherent with the whole "prophet Muhammad" narrative. There was also another reason. One of the chief motive of the official story was to undercut the legitimacy of the Umayyads by painting them as usurpers. To that end, the 4 Rashidun Caliphs' period was invented, probably by reusing some real material about a number of Arab chiefs which had held local sway in various areas before the Umayyad consolidation in the 660s.
Making an ancestor of the Alids one of the 4 Rashidun Caliphs had 2 advantages: First, it lent greater antiquity to the movement that had just gained power in the 750s by positing that some of its leaders' ancestors had held power over all Arabs more than a century ago. And second, it made the Umayyads, instead of the Abbasids, the chief betrayers of the Alids and made them responsible for their marginalization. At first, few people would have been fooled of course but the courtly omerta would have made it impossible for anyone to say anything but "of course, O Commander of the Faithful, you are most right, it is really such a shame that those dreadful Umayyads took away the Caliphate a century ago from the righteous hands of Ali" Dignitaries would have been all the more willing to say such things that they were benefitting form the new order of things. After one or two generations of colluding silence and relentless dissemination of the official story, most people would have been too young to know that this version was not the truth.
Even the Alids had an interest in colluding in the fabrication. After all, it granted them the most senior relationship to the "prophet's family". For a long time, there must have been great hopes that a rebellion against the Abbassids colud be mounted under such a banner.
Regarding the Ibadis, they are probably the descendants of a coalition of dissident movements dating from various periods. Some of them might have been supporters of the Umayyads and of their efforts at building a "neutral monotheism" around the Quran in the late VIIth century. However, after a while, they too had to fit into a narrative that everyone eventually took at face value. They therefore painted themselves as the "most faithful followers of the prophet" by rewriting their own history as one of dissidence starting even before the end of the Rashidun Caliphate. It was as close as they could get to the truth given the climate of the times. After all it is not much worse than "
Nos ancêtres les Gaulois" ("Our ancesters were Gauls", in French) which was purportedly printed in all history books distributed by the French colonial authorities in African schools in the first half of the XXth century.