Screw theory and higher order kinematic analysis of open serial and closed chains