refactor exchange test to create a client and connect/disconnect after each test
move error constants to global namespace
added autotest for invalid exchange declarations
added all tests around exchange declaration