Separated and documented the high level modules of the core query system.