Mass and inertia are now correctly computed for each segment.

The mass and inertia selection/computations were done in the wrong loop, so
the same inertial properties were used for each segment. This remedies that by
moving the computations into the force/moment loop.