General code cleanup

Replaced ".insertAdjacentHTML" with jQuery selectors and functions