Use url.parse instead of manually checking baseURL.

```
> url.parse('localhost/').href
'localhost/'
> url.parse('app://localhost/').href
'app://localhost/'
> url.parse('https://localhost/foo/').href
'https://localhost/foo/'
```