Add unit tests for the MainActivity

This provides nearly 90% coverage. Need to test the adapter for the gallery
seperately.