moving request proxying code to it's own file
tweaks to pass jshint