Speed up imports

Slight optimizations to how we handle imports;  this prevents a import from being parsed more than once.