Expose logic to build URLs -- for programmatic use

We needed this to add URLs to an appcache