Fixed the gradient functions so that they point in the (correct) direction of maximal increase in the function rather than the (incorrect) direction of maximal decrease.
Added the CorticalPotentialFunction, which creates an energy and gradient function for the given surface or map.