moving wyatt's awesome code into a handlebars template and jquery plugin