Changed test to use test config if it exists and to utilise the environment variables if they're set. In this way we can have different settings between CI and local machine builds.