Section 22. Any city, except Boston, and any town containing more than ten thousand inhabitants, may provide for the appointment of a person other than the clerk to be registrar. Such registrars, and in Boston the city registrar, shall be sworn and the provisions of this chapter relative to clerks shall apply to them.