Bugfixes and improvements.

- Export implementation is now different for local and remote.
- Added get_client, for automatic client selection.