Importer refactor

Merge of first round of importer refactorings with @motasem-salem work effectively merging #140 and #149.
This should probably be removed in the future - a cryptic error type doesn't do anything for the client