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/'
```
Merge pull request #2088 from rwjblue/use-url-parse

Use url.parse instead of manually checking baseURL.