Sort keys for stable generation

Hey! Was having a little problem where the generated file was re-shuffling itself each time. This should solve that.