Also includes some coding standard improvements and optimizations such as not adding Drupal settings and JS files if it's not actually used on the page, or calling $(this) multiple times.
$(this)
Closes #3476380