Use query objects to encapsulate the work
Move the doQuery part to the query.js module
Refactor displaying of table results
Refactor query list display
Put test button in front of save

This makes the test button the default button in case of an unexpected
"Enter" press so that the query is not saved in the middle of editing.
More refactoring to save through the query object