Support/refactor request setup tunnel

A refactoring that came out of #1071 
In this pull request I refactored the setupTunnel prototype method.
Basic logic extraction came about and some comments on what's happening

review or comment? @FredKSchott @nylen @mikeal