Changed structure for connection config in test/common.js

Moved all the configs, which can be modified by the environment to a config object, which is then used when creating connections. At the same time allow the password and database to be set for the current environment.