However, the external agent that works against gravity, will be affected by the path. In travelling a closed path from A to D and then back to A again, the net work done by gravity is zero. The work done against gravity in going up, is matched by the work done by gravity is going down. When this happens, the force is said to be a conservative force. A conservative force does no net work in going through a closed path.
Friction is a non-conservative force because it always opposes motion, it never adds to it.
Resolving the 150 year argument. The argument was resolved when the quantities could be expressed properly. We start with the effect of force through distance. The quantity is called the kinetic energy, T, and has the Joule for its unit. Thus, the effect of force through distance , which is called the work done by the force, changes the kinetic energy.