xml3d.js: Fixed transformation bug.

Side effect caused center field in the transform element to toggle from negative to positive
each time when matrix was computed.

Beware of optimizations !
Added utility functions.