Properly interpret URLs in the presence of a <base> tag (closes #254)

The existing checkBaseURL function fails to correctly parse URLs under a wide variety of circumstances, all of which result in an infinite spawn of windows in Internet Explorer 8. This pull request remedies the check and generates valid URLs in the presence of a ```<base>``` tag.

Tested and works in IE6-8.