Enable table sorting

Wow, that was hard! I think I'm going to take the rest of the week off.