fix inability of gateway to handle dicts and add  unicode to utf8
Merge branch 'master' into COI655