Alterations to support HTTPS requests in a browser environment when the library is loaded via browserify. 

The changes are minor and they are related to the fact that browserify does not resolve dynamic paths when building client-side browser javascript. So, when modules are loaded using the optional() module, they are loaded dynamically (their names are passed in) so browserify can not resolve the dependencies - since the resolution happens before runtime. 

This minor fix uses the process package to determine if the environment running the module is in fact the browser, and if it is, we explicitly import modules rather than using the optional flag.

e.g.

https = optional('https')

became:
 
https = process.browser ? require('https') : optional('https')