Move import machinery into it's own function

Testing bootstrap() will be dificult, this allows us to isolate
imports so that they can happen in a subprocess easier.