Added some sorts to star module

I'm sorting the output of some functions so that the results are more
predictable and hopefully the tests will be more robust.