Possible solution in https://github.com/mdxs/gae-init/commit/47db9e61d68de61858d6760462c09f0b8d98b7c4 using OrderedDict (see http://docs.python.org/2/library/collections.html#ordereddict-objects)