Performance improvements to WebAgg backend
Address @pelson's comments in the PR.
Merge pull request #2261 from mdboom/webagg-improvements

WebAgg performance improvements