Move add method from R/repository.r to R/index.r