Convert library into jQuery plugin