Improve baseUrl implementation.

It cleans up some of the parts of the implementation to make it more consistent.
The biggest change is that the GerritConfiguration now cleans up the baseUrl to
make it URL compatible at all times.