refactoring to use request module

* adding the ability to set an http proxy