Implement unit tests for Curve#getCurvatureAt().
Clean up code a bit in Curve#getCurvatureAt().