Choose ports dynamically

ran grunt test.
If this is easy to do it might be good.  Typically Promise rejection functions take 1 arg which is a JavaScript Error object