Importer refactor

Merge of first round of importer refactorings with @motasem-salem work effectively merging #140 and #149.
Probably and a whole lot more. I don't really envisage much of this code being used indefinitely. The point of the first refactor was to emulate motasem's implementation while separating out concerns to make future refactorings smaller and easier, and at the same time having code that is easier to understand and test.