jquery to npm and code cleanup