Refactor sorting of results into a single function

## Changes in this PR:
* Reorder the parameters of the `query` method so that `payload` is optional
* Make all functions run out of the `main.py` file, thus making `ghrequests.py` redundant
* `ghrequests.py` has not been deleted as of yet, since it may be useful for future reference


@robertkluin-wf @beaulyddon-wf @amandeepgill-wf