Adds unit tests for SearchController

Plus fixes a small bug - the result count from the previous search was not reset when user starts typing a new term.