Rework unit tests to make them order independent

The mock config dictonary gives different results based on how the dict is
iterated over. The tests need to be more robust against different run orders.