Implements refactoring function for removing unneeded querying on top of a single course query
Implements more tests for refacotring
Moves refacotring tests to the end of the query unit tests