Sync with latest TNG library version. Improvements to writing TNG files.

Change-Id: I88d257e8af24b1d71f8de908790db693dafe241d