Put jQuery code inside the anonymous "remap jQuery to $" function

At _/js/functions.js, it uses an anonymous function to have a local `$` variable with jQuery. That `$` variable only exists inside the anonymous function, so the current way its written doesn't make much sense - the rest of the code should be inside that anonymous function too.