Workaround for IE dropping the leading slash in pathnames

Various versions of Internet Explorer seems to neglect the leading slash under some conditions (not when watching it with the dev tools of course!). This was confirmed in IE10 + IE11

Fixes #809.
To fix that issue, this test should be 'if (pos === 0) { path = '/'; } else if (pos !== -1) {'