Prepare import-endpoints for new features

- refactored out logic from I/O and printing
- added tests for logic