Ajax: use anchor tag for parsing urls

Ajax: don't use new url parsing for url rewriting

Ajax: cut down on unnecessary variables

Ajax: fix indentation of multi-line statement

Ajax: parse origin URL using an anchor tag too (for IE)

Ajax: some IE fixes.

IE only does URL cleanup on for .href
IE also throws errors for malformed URLs.