Refactor SearchApiController and add tests

Adding in tests to the search API controller so future changes to the Wikia search library get caught won't result in P2 bugs, but unit test failures on dev instead.