Today I tried to make a joint that inherits from cpPivotJoint, but I ran into a couple of snags. There isn't really any elegant way to supply my own cpJointClass object, and calling the inherited preStep and applyImpulse functions is not possible.
May I propose something like the attached patch? It just exposes a couple of static functions and slightly modifies the interaction between the new and init functions.
It touches only cpPivotJoint, but if you like it, I can make a new patch which does the same to all the joints.