added spline fitting routines and moved comparators to their own file.
removed lots of unused code from stemutils, refactoring handling of potential computation.