Changed function so that it more evenly subdivides the bezier curves.

Also moved pairwise function into generalfuncs and made
other uses of pairwise import it from generalfuncs.