Added type-switching logic and string handling

Hurray for default utf8/unicode :)