Backport 2bc40ad87be072aac2759755df63707d43f8415c.

Thanks to Thomas Martitz for the backport.

Sort object dependancy before saving using a topological
sorting algorithm _glade_tsort() instead of g_list_sort() with
glade_widget_depends() which is not a transitive property.

Closes Bug 709609 "[PATCH] Change way of sorting before writing XML output."
Fixes Bug 711858 "editing glade project results in long CPU usage spikes after upgrading to 3.16 and GTK+3.10"

This backport includes 1401a4bb43a3e56d642c34d5dc7d5ee86217cb3d which reverted
part of 2bc40ad87be072aac2759755df63707d43f8415c.

Conflicts:
	gladeui/Makefile.am
	gladeui/glade-project.c
	gladeui/glade-widget-adaptor.c
	gladeui/glade-widget.c
	plugins/gtk+/glade-gtk-entry.c
	plugins/gtk+/glade-gtk-size-group.c
	plugins/gtk+/glade-gtk-tree-view.c
	plugins/gtk+/glade-gtk-widget.c
	plugins/gtk+/gtk+.xml.in
Backport 2fcad158ebafce63eeccfbfc7756ed6c69d91c3c.

Thanks to Thomas Martitz for the backport.

_glade_tsort() simplyfied api by using a GList for edges instead of a
custom linked struct since we do not need the marginal speedup
now that dependencies are only between toplevels.
This allow us to easily sort edges alphabetically.

tests/toplevel-order: Updated to new _glade_tsort() api

Conflicts:
	tests/toplevel-order.c
	tests/toplevel_order_test6.glade
Backport 56f47169dc09cfd6ed13a24cb9752050ecb66d6f.

Thanks to Thomas Martitz for the backport.

GladeProject: Changed the way we calculate graph dependencies.
Instead of using glade_widget_depends() which implied N^2 invocations/iterations
(where N is the numbers of objects in the project) we now calcualte
dependencies based on property references.
This way we only have to iterace over every object once to check the list
of properties that constitute a reference to them.

In a real world example, sorting objects in geany.glade decreased from 120ms to just 1ms

plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk-widget.c:
  Removed unused glade_gtk_widget_depends()

Conflicts:
	plugins/gtk+/glade-gtk-widget.c
Backport c4c50ab2d1f436f61c4a46986dc7b598d562c99e.

Thanks to Thomas Martitz for the backport.

Ignore widgets that are not part of the project when generating edges
of directed graph used to sort objects by topological order.

Fixes bug 727992 "Editing UI and saving does not remove deleted Combo with Entry"