ik: Refactor CCD and FABRIK to use utility functions.