Testing JavaScript and jQuery design patterns