Sorting
Save and load sort info.
Realized that sorting only sorts the pages, I need to merge the pages together and sort then, then respread them as pages again.
This was the primary reason why I used to have the flatten function.
Remove some unneded code
Fix ordering issue
Inheritance
Fix sorting
Add comments and move funcs around