More refactoring to reduce the amount of code in QueryController. Also reinstated some tests and mreged the two partials: _table.html.erb and _word_options.html.erb