This patch extends the FileSystem class with a bunch of operations that are currently implemented as methods of the FileSpec class.
The implementation uses the virtual file system which means that the class is now stateful. I've turned it into a singleton because:
- We need it for the shared module cache which lives above the debugger.
- Passing it around would be inconvenient as we'll need it wherever we want to manipulate a file. I also don't think passing the FS as a parameter convey any useful information from an API standpoint.
This is the first patch in a series that will remove methods manipulating the filesystem from FileSpec. As I make more changes I might have to updated it or extend it with new methods.