When not otherwise provided by charter provision or general law, the mayor of every municipality shall be the chief executive officer of such municipality, shall have the powers and authority granted in this section, and shall see that the ordinances, orders, bylaws, acts, resolutions, rules and regulations of the governing body thereof are faithfully executed. He shall have jurisdiction to hear and determine any and all alleged violations thereof and to convict and sentence persons therefor. He shall also, until January 1, 1977, be ex officio a justice and conservator of the peace within the municipality, and shall, within the same, have and exercise all of the powers, both civil and criminal, and perform all duties vested by law in a justice of the peace, except that he shall have no jurisdiction in civil cases or causes of action arising without the corporate limits of the municipality. He shall have, until January 1, 1977, the same power to issue attachments in civil suits as a justice of county has, though the cause of action arose without the corporate limits of municipality, but he shall have no power to try the same and such attachments shall be returnable and be heard before some justice of his county. Upon complaint he shall have authority to issue a search warrant in connection with the violation of a municipal ordinance. Any search warrant, warrant of arrest or other process issued by him may be directed to the chief of police or any member of the police department or force of the municipality, and the same may be executed at any place within the county or counties in which the municipality is located. He shall have control of the police of the municipality and may appoint special police officers whenever he deems it necessary, except when otherwise provided by law, and subject to the police civil service provisions of article fourteen of this chapter if such civil service provisions are applicable to his municipality, and it shall be his duty especially to see that the peace and good order of the municipality are preserved, and that persons and property therein are protected; and to this end he may cause the arrest and detention of all riotous and disorderly individuals in the municipality before issuing his warrant therefor. He shall have power to issue executions for all fines, penalties and costs imposed by him, or he may require the immediate payment thereof, and in default of such payment, he may commit the party in default to the jail of the county or counties in which such municipality is located, or other place of imprisonment within the corporate limits of such municipality, if there be one, until the fine or penalty and costs shall be paid, but the term of imprisonment in such case shall not exceed thirty days. He shall, from time to time, recommend to the governing body such measures as he may deem needful for the welfare of the municipality. The expense of maintaining any individual committed to a county jail by him, except it be to answer an indictment, or, until January 1, 1977, be under the provisions of sections eight and nine, article eighteen, chapter fifty of this code, shall be paid by the municipality and taxed as part of the costs of the proceeding.