Encapsulate into a jQuery plugin