Bargaining and Agenda Formation in Legislatures