Change $ to jQuery in case of undefined/conflict

Fixes `Uncaught TypeError: Cannot read property 'inArray' of undefined`