Implement the RepositoryListener as an inner class in ExternalService.

This avoids implementing RepositoryListener on the top level, which allows
subclasses to use RepositoryListener as they see fit.