Store data type in changeset info.

Also utf8 encode some stuff and use a do/while loop instead of a while loop.