Object-oriented implementation of a graph-theoretic formulation for planar multibody dynamics