Added single-file version of find_fold_points so that it's easier for others to use.