The legislature by general law shall authorize two or more counties, townships, cities, villages or districts, or any combination thereof among other things to: enter into contractual undertakings or agreements with one another or with the state or with any combination thereof for the joint administration of any of the functions or powers which each would have the power to perform separately; share the costs and responsibilities of functions and services with one another or with the state or with any combination thereof which each would have the power to perform separately; transfer functions or responsibilities to one another or any combination thereof upon the consent of each unit involved; cooperate with one another and with state government; lend their credit to one another or any combination thereof as provided by law in connection with any authorized publicly owned undertaking.