Fixed windows build behind proxy

This update is to allow this grunt task to work behind a corporate proxy (using npm) and also allow it to run correctly on a Windows environment which it did not seem to do (I see someone else created an issue here that was similar https://github.com/ronaldlokers/grunt-casperjs/issues/61 ). I've been using this for quite a while in our environment and it appears to work fine. I just thought I'd clean up the commits and do a pull request back to you guys so you could take advantage of this change.