Refactor basic provisioning

Several refactorings to split up `_basic_provisioning()` and `prepare_environment()` into smaller methods and move to `ci_base.py` the methods that exhibit [feature envy](http://sourcemaking.com/refactoring/feature-envy).