jQuery might be undefined, bad variable in use

if jQuery was undefined there were error when trying to use it. Also $ var was passed to closure but jQuery was used - if jQuery.noConflict if being used, one of them might be undefined.