implement the remaining curvature and bending terms for the energy gradient. These are not working yet, though. [[Imported from SVN: r8408]]