fixed bugs in exchange.js. included exchange.js in test file