Reordered results in table, auto-tab switching

The table data is loaded in an sensical order. The program automatically
switches to the results tab when "run query" is pressed.