Refactor reorder algorithm to match the algorithm in the paper
First draft of a almost working algorithm
Additional refactorings
Additional refactorings
More fixes
Add debug build
Add search depth
Cleanup and fixes