The two-sorted algebraic theory of states, and the universal states of MV-algebras