Complete (untested) code for memory-sensitive bootstrapping procedure.