Fix interchangeable use of jQuery and $.

This code would break if there is no global $. In addition, you have no
guarantee that the global $ and the one passed by requirejs is the same
version.