[SEBA-450] (part 1)

Refactoring, python3 compat, and tox tests on:

- xosconfig
- xosgenx
- xosutil

Eliminate use of yaml.load() which is unsafe, switch to yaml.safe_load()

More diagnostics during database migration

Change-Id: I0fae5782fca401603a7c4e4ec2b9269ad24bda97
diff --git a/lib/xos-genx/xosgenx/targets/modeldefs.xtarget b/lib/xos-genx/xosgenx/targets/modeldefs.xtarget
index 15c43d7..ec7e5f2 100644
--- a/lib/xos-genx/xosgenx/targets/modeldefs.xtarget
+++ b/lib/xos-genx/xosgenx/targets/modeldefs.xtarget
@@ -8,7 +8,7 @@
   {%- if m.options.verbose_name %}
   verbose_name: "{{ xproto_unquote(m.options.verbose_name) }}"
   {%- endif %}
-  fields: 
+  fields:
   {%- set id_field = {'type':'int32', 'name':'id', 'options':{}} %}
   {% for f in (xproto_base_fields(m, proto.message_table) + m.fields + [id_field]) | sort(attribute='name') -%}
   {% if xproto_unquote(xproto_first_non_empty([f.options.gui_hidden, 'False'])) != 'True' and (not f.link or f.options.link_type != 'manytomany') -%}
@@ -25,7 +25,7 @@
   {%- if f.options.choices %}
     options:
     {% for o in xproto_options_choices_to_dict(xproto_unquote(f.options.choices)) %}
-    - {{ o }}
+    - {{ xproto_dict_to_sorted_string(o) }}
     {% endfor %}
   {%- endif %}
     type: {{ xproto_type_to_ui_type(f) }}
@@ -50,4 +50,4 @@
   relations: []
   {%- endif %}
 {%- endif %}
-{% endfor -%} 
+{% endfor -%}