fixed ray-curve intersection, and heavily refactored the curve reordering code.
Merge branch 'master' of github.com:appleseedhq/appleseed