Separated out some bezier curve stuff (still needs work).