I am looking to figure out a way to sort people into classes by preference.
For example, say there are 100 students that are each going to be assigned one of five classe
From your description, this sounds very much like one of the variations of the Stable Marriage Problem
Check the Wiki link and you will see a description of the Gale-Shapley Algorithm, which is a good solution.