d2: More unification and add init_d2.c

Signed-off-by: Brandon McAnsh <brandon.mcansh@gmail.com>

Conflicts:
	extract-files.sh
	setup-makefiles.sh