EMI: Fix attach and detach (again)

This change set is based on #943, once that's merged, I'll rebase this.

This change set is still incomplete, but I'd like some feedback!

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).