First refactoring to support Selendroid standalone server.