4010 Clean up import code and tests
Merge pull request #1691 from sarken/issue_4010

4010 Clean up import code and tests