Refactor test env vars into init module, add additional vars to control test port numbers

On my dev box, tests that have 1022 and 1023 hardcoded hang indefinitely because they have been opened by another unrelated application. This PR allows developers to specify ports other than 1022 + 1023.