Wrote a quicksort macro and modified sort_list to use it
Made clang happy by taking definitions for the macro out of functions and adding declarations
Cleaned up pull request.