Added allSubsets() to support ResourceManager.
First draft of intelligent ResourceManager. Associated refactorings in other files to support ResourceManager design.