Clean up ImportMaterialsTask

Split the massive "Run" method into smaller methods.