Reusable server url

Improve the re-usability of the addQueryArg() method

- Support SSL protocol
- Make the serverUrl code re-usable
I sort of figured that, but then looked at the other five lines and saw you didn't space those out...