Scheme relative fixes

There are some hardcoded dependencies for http:// and non-scheme relative URLs, which breaks when trying to deploy a https:// site with scheme relative URLs. This fixes some of the issues.