Simplify curve fitting code and remove a lot of unnecessary dependencies. The implementation is now derived from a single source file from the original Graphics Gems code (public domain).