Refactoring running of selenium tests environment, so that it would be easier to do that. (cherry picked from commit 09c5e46)