Merge pull request #504 from bhariharan/unstable

Fix to prevent testSearch() from flapping
Refactor the activity instrumentation test cases