A "changing chart" symplectic algorithm for rigid bodies and other dynamical systems on manifolds