When writing multiple UV sets, use currentUVSetName to determine which one
should be the primary UVs for the mesh and NOT the first UV set.

Also do some small style updates.