Pass global and file metadata/contents together to plugins

Currently a plugin in the chain is called once for each file. (Plus potentially once for initialization, before the regular calls.) This is not really flexible, as it is not possible to

1. Add global metadata, based on the file(s). E.g. a `collections` plugin would need to add a global index of the collection(s).
2. Add metadata based on multiple files. Again, a `collections` plugin would need to add `next` and `previous` pointers to the file metadata, based on other files.
3. Add files to the chain. E.g. the `rmarkdown` plugin creates extra files, images, potentially JS and CSS files. These should be added to the chain.

Etc. It is much simpler to pass both the global metadata and the file metadata to the plugin, in one go.
I see. I thought only `[[<-` (and co) were hacked not to copy. So lists are good.

Re API, maybe we would not necessarily need refclasses, just closure, e.g. 

```r
rsmith <- function() {
  files <- list("foo", "bar")
  metadata <- list(src = "src", dest = "dest")
  get_files <- function() files
  get_meta <- function() metadata
  set_meta <- function(key, value) metadata[[key]] <<- value
  ## ...
  list(public_api = list(get_files = get_files, get_meta = get_meta, set_meta = set_meta))
}
```
and then we could pass `public_api` to plugins. Although, you might argue that this is actually reinventing reference classes....