Issue #1880798 by droplet: Improve tableselect.js performance.

Replacement PR for https://github.com/backdrop/backdrop/pull/314

Part of issue https://github.com/backdrop/backdrop-issues/issues/211.