bootstrap: move all the logic for bootstraping python into python as soon as possible.