Refactored Algorithms to accompany Quicksort

Quicksort is included in this commit.