Refactor to idiomatic JavaScript

About 25x faster in Chrome
About 8x faster in Safari
About 6x faster in Firefox
About 4x faster in IE
Merge pull request #1 from arv/cleanup

Refactor to idiomatic JavaScript
Put back into URL namespace, use feature detection

shorter urls
Merge pull request #2 from azakus/url-feature-detection

Put back into URL namespace, use feature detection
make sure we give a copy of base._path to new url to not modify base

add test for unchanged href
Merge pull request #3 from azakus/fix-base-path

Fix base path