Improved reloading of fitted parameters

Before, the functions might get loaded in the wrong order. Now, I have
given each one a unique index that is used to sort reloaded functions.
Also, successive functions are subtracted before guessing the
parameters of the next one, so the order helps make guesses more
accurate.