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 rememdies that by
moving the computations into the force/moment loop.