Detect ASCII field types more rigorously, and write their correct length when writing TIFF tags. This is based on bits from SANSELAN-51 and SANSELAN-12, however neither of those is complete or correct by itself or even when they're put together. This resolves SANSELAN-12 and fixes part 1 of SANSELAN-51. Jira issue keys: SANSELAN-12 , SANSELAN-51