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. This pull request remedies the check and generates valid URLs in the presence of a ```<base>``` tag.