Fix skill sorting

I saw you pulled some of the changes from my fork, so you might be interested in this. It turns out the index I used doesn't actually represent the order skills are learned in. I added a new function that infers the order based on the dependency graph. It's kind of crazy, but I couldn't find any other representation of the order you learned the skills in!