Attempt to fix import sequencing

 - [x] make the imports always loaded in a consistent order
 - [x]  - stretch goal process the imports containing variables after all of imports have been processed