better defaults for port

Currently the port defaults to `window.location`. This change assigns `80` and `443` as the port for http and https URLs respectively:

```js
var parse = require('url').parse
var url = parse('http://google.com/')
assert(80 == url.port)
```

This avoids the port being assigned to 3000 (or whatever) as in `make test` on master.