Fiddling around with core JavaScript and jQuery (mixin)