Use explicit parts of window.location to build the url. Closes #3