Make jQuery known as the global symbol instead of $

To make it actually compile again.
Define $ variable in correct scope
Merge pull request #400 from dwt/jquery-noconflict-fix

Jquery noconflict fix (bug fixes for #396)