src/cod: Make adding socket handlers to cod easy