py3: don't use deprecated print statement
py3: .keys() return dict_keys, turn it to a list
py3: add unicode, basestring and long funcs, removed in Py3