Made the dirs get sorted before files in the file browser.

This was the first time I ever touched C code. It feels... raw! =-)
It took me about 2 hours to do something as simple as this...
Regardless, it is working.
It is inefficient, though. I am iterating through a list twice, since I couldn't find a way to do everything in the same loop. I could neither create 2 lists and then merge them, and using *prepend* would result in reversed order dirs...
This should close #3.