Split compute_accel() into 2-body and 3-body components.