Corrections to JavaScript

Corrections to JavaScript:

* $ alias instead of jQuery.
* Attach external handler only to links, namespace it and prevent default action only.