Tidy up with Jquery in application constants, some encapsulation added, simplifying behaviour in panel switcher