MATH: Change the rotation3d implementation to allow different rotation orders.
EMI: Fix attach and detach coordinates.