However, Torah couldn't possibly be written before the split between Israel and Judah. They each got their own slightly different torah. Neither have power to "correct" the other.
I disagree. The fact that both Israel and Judah have their own slightly different version of the Pentateuch is actually evidence that the Pentateuch was written before the split, and changed slightly by one or both groups through the years. However, this split need not be the split between Israel and Judah after Solomon, but may simply be any point in time at which the Pentateuch came under the protection of two independent groups of people with different religious convictions (i.e. Jews and Samaritans).
The discussion of when and how it was compiled is long and complicated, with many strong and weak arguments on either side. Modern scholarship is very divided. In the words of Wikipedia,
Today the majority of academic scholars accept the theory that the Torah does not have a single author, and that its composition took place over centuries. From the late 19th century there was a general consensus around the documentary hypothesis, which suggests that the five books were created c. 450 BCE by combining four originally independent sources, known as the Jahwist, or J (c. 900 BCE), the Elohist, or E (c. 800 BCE), the Deuteronomist, or D, (c. 600 BCE), and the Priestly source, or P (c. 500 BCE).
This general agreement began to break down in the late 1970s, and today there are many theories but no consensus, or even majority viewpoint. Variations of the documentary hypothesis remain popular, especially in the United States of America and Israel, and the identification of distinctive Deuteronomistic and Priestly theologies and vocabularies remains widespread, but they are used to form new approaches suggesting that the books were combined gradually over time by the slow accumulation of "fragments" of text, or that a basic text was "supplemented" by later authors/editors.
The fact that there are so many different views, even amongst those who agree on that the Pentateuch developed over centuries and is the result of many different authors' hands, there is significant divergence. So we have two choices: either we believe by faith the vast majority of the Pentateuch is the work of a single author, as indicated by the New Testament, and find ways to resolve apparent inconsistencies in it. Or we ascribe to one of the dozens of "redaction" theories, which have the advantage of making apparent inconsistencies acceptable, but have the disadvantage of being, to a large extent, based on speculation seeking evidence.
Much more could be written about the authorship of the Pentateuch. Indeed, much more has been written. Happily, one doesn't need to be a scholar to make an informed decision: critically considering the strongest arguments of each side should suffice.