Change method name to be more explicit
Fix selector for tab selection
Tidy up whitespace and line-endings
Renames to reflect what's really going on
Document methods
Write tests to expose tab bugs
Only remember the selected tab when it was chosen

Until now we were 'remembering' the active tab, whether that was the user's
choice or our default.
Fix list of allowed tab selections

Hadn't been updated since the tab redesign
Change method name and document for clarity
Correctly set the defaultTab in some situations

In the following situation:
  * user had not selected a tab at any point
  * the first tab had no results
  * the second tab had results

The server would default to the first tab with results, but this Javascript was
not paying attention to that, and instead was selecting the one the user had
previously selected (if any), otherwise the first tab.
Merge remote branch 'origin/fix_tab_selection'

Conflicts:
	app/controllers/search_controller.rb - adding/removing helpers
	test/functional/search_controller_test.rb - new tests in same place