creating amd compatible version of jquery plugin