Will try to find a better way to do this (or at least write some descriptive comment) but was basically pulling the field name ('name', 'test_status', etc) out of the columns, then grabbing of the similar values for our sort options and figuring out which ones are only being used to sort by.