UI optimisations

I have changed the way file selection works, supporting larger folders. It now sorts using a templated version of Quicksort (so you can add more than just "is directory" as metadata later on) using a custom sort function that places ".." first. Bubble sort was slow on larger folders, as you can imagine.

A memory leak when returning from the file selector meant that loading a ROM from a 2000-item folder (just copy-pasted Tetris 1999 times for this test :D) shut down the DS when going back into a file selector. This is now fixed.

Also, the 3D hardware is powered off. If your "all backgrounds and sprites as one image" code, required for scaling, ends up being a 3D texture, then you will need to revert commit 8a8ca6abb7b39b6a69cd43c8000cb08db701d2ee.