Choose ports dynamically

ran grunt test.
Oh! Let me try changing the promise (line 82) to <any>