Make the JSON load order use BFS (again).

This actually redoes what 55af2d9 was doing, but correctly this time.

It turns out that `if (stat(path, &st) != 0x4)` is the same as `if(true)`, because `stat(3)` can only return 0 or -1. This was coincidentally working before, in spite of the comment assuring us that it would `// Check to see if it is a folder!`.

So, having corrected that failure and reorganized the code a little (it was still managing to recurse because it was using `opendir()` to check for folder-ness), this now *actually* works.

I guess I didn't check it before. Oops.
That's part of merge-testing, so yeah.  Build's finishing now.