Replaced toggleClass with add/removeClass where appropriate
Merge remote-tracking branch 'upstream/master' into Issue-3338
Added a util function toggleClass
Fixes after review
Merge pull request #3689 from WebsiteDeveloper/Issue-3338

Replaced toggleClass with add/removeClass where appropriate