Reduce dependency on jQuery.
Make external URL decoration more robust.