Added many tests and began debugging the sortByRating function