Add a separate map for captured variables.

(This must go with the accompanying patch to `snap-core`.)