Finally have everything working as a jQuery plugin