Sort Bug Fix

Javascript cares about the case of characters when sorting so made a
change to call .ToLowerCase() when sorting. Also refactored out methods
as there were multiple sort calls doing the same thing that I had to
edit multiple times before the refactor. :yum: