Big imports

Reworked importer code in various places.