Primary section 

Summary of changes:

(1) Add logic to determine the primary section.  If the sis_section_id matches the course_instance_id, this section name is considered the primary section and will appear at the top of the list

(2) Code cleanup, remove unused code and reduce the length of the lines to under 80
For cross-listed courses, the sis_section_id of the cross-listed section(s) will not be the same as the course_instance_id of the primary course.  Maybe I'm missing something, but this code doesn't look like it will treat the cross-listed sections as primary.