About to refactor to use ParTopSort
Refactor to use ParTopSort STAGE 1
Refactor to use ParTopSort STAGE 2
Refactor to use ParTopSort STAGE 3
Refactor to use ParTopSort STAGE 4
Refactor to use ParTopSort STAGE 5
About to simplyfy loop and bad graph detection a lot
Finally passes all unit tests, needs a big tidy up and even more unit tests