The first five books of the Bible, Genesis, Exodus, Leviticus, Numbers and Deuteronomy are known as the Pentateuch. They are also known as the books of Moses. However, attribution of the final version of these books to Moses is a later convention: there is nothing in these five books that implies that they were written by Moses. The most likely scenario is that Ezra was the creator of the final text of these works, bringing them out of the disparate sources from which they were constructed.
If we carefully examine the text of the first five books of the Bible, we can see that different parts of these works were written at different times, reflecting the thinking of the individuals who wrote the text and the times at which the various parts were written. The result is that we can arrive at a picture of the formation of the Pentateuch / Torah  that is inseparable from history. As such it is much more useful to us than the imaginary construct that has dominated much of our thinking up to this point, for it informs us about the things that were of concern to the people who wrote each of the component parts.
Despite their differing origins, the various components of the Pentateuch have a united feel, suggesting that they were brought together by a skilled editor. This editing process can only be dated after all the components were completed. As a result, the process has to be placed after the end of the kingdom of Judah. But at what point would it have been done, and who did it?
Only two men are known as law-giver in the Old Testament. These are Moses and Ezra. Â As someone endorsed by the Persians to lead a party back to Israel and to teach the law of Yahweh to the people, he is the most likely to have had access to all the documents. He also gave public readings of the Torah.
Because of the dominance of the P Source narrative in the Pentateuch, one can say that the whole work has a priestly emphasis, and one given through the eyes of those priests who descended from Aaron. Ezra falls into this category.
The final editor of the Pentateuch is likely to have been Ezra. Even though it remains open to debate, there is no-one else with any claim to this title whatsoever.
Bibliography
Richard Elliott Friedman, Who Wrote the Bible? (Engleword Cliffs, NY: Prentice Hall, 1987).