Some refactoring of the sync script
Do not use the python reserved keyword dir
Add function to convert values to unicode
Move convert2unicode to utils to avoid circular dependency
convert2unicode does not return
Fix bug 13655