https://github.com/medialize/URI.js/blob/gh-pages/src/URI.js#L182