core: Move active code out of installer/*/prepare, split core.

core.minimal contains only the bare minimum for other targets
to run.