I think this is one of those cases where an implementation detail forces you to use a tool in a specific way. ie. code stored in a hierarchical filesystem forces you to structure your program in such way.
The problem with hierarchies is that they are strict and rigid and force you to put your code in a dichotomy that is very ill suited for a multi dimensional problem like computer programs.
What you want is to abstract away the file system from the programmer and treat it as an optimization problem for the IDE to feed into the compiler.
Ultimately the source code would be stored in database that is closely modeled after the language specification, as a normalized, canonical representation of the program.
All the features that you wrote about would then be views on top of that database. That way you can choose a representation that fits the task you are currently trying to solve.
Big problem I see with this, like others have said, is the tight coupling to the IDE.
But it could be interesting nevertheless, I actually thought about this exact thing before.