Minor external link fix

* Added support for "javascript:" URIs in external links, and fixed
"mailto:" syntax highlighting.
* Also fixed it so that 'state' is undefined while script passages are
executed. This should fix a bug with some popular old scripts.