Implement exchanges.

Fixes #5073