Reversible molecular dynamics for rigid bodies and hybrid Monte Carlo