Started logically refactoring table_sorter.js
Finished refactoring for now