improve current URL detection (in JS)

fixes https://github.com/killbill/killbill/issues/245
Merge pull request #246 from kares/patch-1

improve current URL detection (in JS)