Refactors Cycles mesh export a bit to avoid unnecessary copies and to be in sync with the Blender baker.