Change all functions to take a code reference

Allows the replacement to fix the CvSTART pointer of the CV
when replacing the first op.