Internal: Refactor sort listener

- Think this code was in DataTables 1.0 and has been relatively
  untouched! A refactor allows it to be more readable and smaller when
  compressed (about 450 bytes saved)