Refactored export and import code.
Added Client-side code for imports.