Better resolution of path and URL.
Updated version.
Merge pull request #4 from theantichris/better-path-and-url

Better path and url