Add support for protocol-relative URLs (i.e. URLs that start with '//')
Reorganize tests into define() blocks.