Code refactor to better address jQuery interaction and JS functions.
Code cleanup