Prevent conflicting use of $ with jQuery

Some files expect $ to be jq, but if jquery is loaded before jq the $ is taken by jquery, causing all kinds of errors. This commit fixes this.