moving tagging js to jquery plugin