Cleanups to GA code

* Use jQuery hasClass.
* Check link hostname instead of URI scheme for external links.