cleaned up some js, table sorting working again