One way to preserve database order using an OrderedDict.
One way to preserve database order using an OrderedDict.

This may have a performance penalty, so perhaps should be looked at again later.
It does at least mean that when you load and save the database, things like the
forbiddenStrutures file end up in the same order as how they started.

Sort order is (highest priority first)
 1. according to the tree, if there is one
 2. according to the entry.index values, if they exist
 3. preserving the order that they were loaded in, if Python > 2.7
 4. random
comocheng/RMG-Py,comocheng/RMG-Py,KEHANG/RMG-Py,KEHANG/RMG-Py,chatelak/RMG-Py,chatelak/RMG-Py,pierrelb/RMG-Py,enochd/RMG-Py,faribas/RMG-Py,pierrelb/RMG-Py,nickvandewiele/RMG-Py,nickvandewiele/RMG-Py,enochd/RMG-Py,faribas/RMG-Py,nyee/RMG-Py,nyee/RMG-Py