Restructuring into a jQuery plugin