The Origins of the State: Technology, Cooperation and Institutions