add tests for exportable extension
reference `root` rather than `window` in legend.js
assign `root` in exportable.js so testing (which uses the scripts without header and footer) will work