Small optimisation to DOM.hasClass() and code formatting of constants