Fix for problem that emerged from #16226 (`.active` class not actually being applied) and expansion of the script to also correctly handle keyboard interaction with checkboxes in `data-toggle="button"` groups