added some changes to the connection and test files for easier integration into 3rd party applications