Changes to import system to make it more flexible, other misc changes.