EMI: Fix attach and detach (again)

This change set is still incomplete, but I'd like some feedback! The actor's position is calculated incorrectly still, but the rest seem to be correct. I don't think the testing patch can be merged.

Currently, the actor's position, world position and rotation are incorrect. This problem isn't obvious because most of the situations where there is attaching and detaching, there is only one actor or one of the actors has a trivial case (such as 0,0,0 for rotation). This fixes the rotation and detaching, but the position is still wrong.
This doesn't take the joint transform into account if the actor is attached to a joint of the parent. Is this intentional?